// DiffuseNonLit.hlsl (c) 2011 JV Software
//

#include "common.hlsl"

Texture2D txDiffuse;

/*
===============
DiffuseNonLitVertex
===============
*/
FPixel_t DiffuseNonLitVertex( FVertex_t vertex ) {
	FPixel_t	pixel = ((FPixel_t)0);
	
	pixel.xyz = mul( vertex.xyz, g_mWorldViewProjection );
	pixel.uv  = vertex.uv;
	pixel.tangent  = vertex.tangent;
	pixel.binormal = vertex.binormal;
	pixel.normal   = vertex.normal;
	
	return pixel;
}

/*
===============
DiffuseNonLitPixel
===============
*/
float4 DiffuseNonLitPixel( FPixel_t pixel ) : SV_TARGET0 {
	// Load the diffuse texture and multiply by the lighting amount
    float4 cDiffuse = txDiffuse.Sample( SampleLinear, pixel.uv );
    
    // return diffuse
    return cDiffuse;
}


//--------------------------------------------------------------------------------------
// Technique
//--------------------------------------------------------------------------------------
technique10 DefaultTechnique
{
    pass P0
    {
        SetVertexShader( CompileShader( vs_4_0, DiffuseNonLitVertex() ) );
       // SetGeometryShader( CompileShader( gs_4_0, GS() ) );
        SetPixelShader( CompileShader( ps_4_0, DiffuseNonLitPixel() ) );
        
        SetBlendState( NoBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
        SetDepthStencilState( EnableDepth, 0 );
    }
}
